//
// Created by francklinson on 2021/7/25 AT 22:49.
//
#include <string>
#include <vector>
#include <iostream>


using namespace std;

class Solution {
public:
    vector<string> simplifiedFractions(int n) {
        if (n == 1)return {};
        vector<string> container;
        for (int i = 2; i <= n; ++i) {
            for (int j = 1; j < i; ++j) {
                if (gcd(i, j) == 1) {
                           container.push_back(to_string(j) + '/' + to_string(i));
                }
            }
        }
        return container;

    }

    // 求最大公约数  辗转相除法
    int gcd(int bigger, int smaller) {
        int r;
        while (true) {
            r = bigger % smaller;
            if (r == 0)
                return smaller;
            else {
                bigger = smaller;
                smaller = r;
            }
        }
    }
};

int main() {
    Solution solution;
    auto ans = solution.simplifiedFractions(5);
    for (auto &x:ans) cout << x << endl;
    return 0;
}

